package com.cskaoyan.javase._1extends._5protected.two;

import com.cskaoyan.javase._1extends._5protected.one.CurrentClazz;
import com.cskaoyan.javase._1extends._5protected.one.SamePackageSonClazz;

/**
 * 不同包下的非子类,能否访问CurrentClazz中的受保护成员呢?
 * 这里的访问方式,仍然有两种:
 *      1.创建CurrentClazz对象,直接访问受保护成员
 *      2.创建CurrentClazz的子类对象,访问继承的受保护成员
 * 两种方式都不行.
 *
 * @since 11:04
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class AnotherPackageClazz {
    public static void main(String[] args) {
        CurrentClazz cc = new CurrentClazz();
        // 'num' has protected access in 'com.cskaoyan.javase._1extends._5protected.one.CurrentClazz'
        // cc.num;
        SamePackageSonClazz ssc = new SamePackageSonClazz();
        // ssc.num;

        AnotherPackageSonClazz ap = new AnotherPackageSonClazz();
        // ap.num
    }
}
